package com.xuecheng.content.convert;

import com.xuecheng.api.content.model.qo.CourseBaseDTO;
import com.xuecheng.content.entity.CourseBase;
import org.apache.ibatis.annotations.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface CourseBaseConvert {
    CourseBaseConvert INSTANCE = Mappers.getMapper(CourseBaseConvert.class);


   @Mapping(source = "id",target = "courseBaseId")
    CourseBaseDTO entity2dto(CourseBase courseBase);

    @Mappings({
            @Mapping(target = "id",source = "courseBaseId")
    })
    CourseBase dto2entity(CourseBaseDTO dto);

    List<CourseBaseDTO> entitys2dtos(List<CourseBase> courseBase);
}
